package com.ruoyi.framework.web.service;

import java.util.List;

import com.ruoyi.project.WebMoudle.WxCitys.domain.WxCitys;
import com.ruoyi.project.WebMoudle.WxCitys.service.IWxCitysService;
import com.ruoyi.project.WebMoudle.WxShopType.domain.WxShopType;
import com.ruoyi.project.WebMoudle.WxShopType.service.IWxShopTypeService;
import com.ruoyi.project.WebMoudle.WxShopWords.domain.WxShopWords;
import com.ruoyi.project.WebMoudle.WxShopWords.service.IWxShopWordsService;
import com.ruoyi.project.WebMoudle.handleType.domain.HandleType;
import com.ruoyi.project.WebMoudle.handleType.service.IHandleTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.dict.domain.DictData;
import com.ruoyi.project.system.dict.service.IDictDataService;
import com.ruoyi.project.system.dict.service.IDictTypeService;

/**
 * RuoYi首创 html调用 thymeleaf 实现字典读取
 * 
 * @author ruoyi
 */
@Service("dict")
public class DictService
{
    @Autowired
    private IDictTypeService dictTypeService;

    @Autowired
    private IDictDataService dictDataService;

    @Autowired
    private IWxShopTypeService wxShopTypeService;
    @Autowired
    private IWxCitysService citysService;
    @Autowired
    private IWxShopWordsService wordsService;
    @Autowired
    private IHandleTypeService handleTypeService;

    /**
     * 根据字典类型查询字典数据信息
     * 
     * @param dictType 字典类型
     * @return 参数键值
     */
    public List<DictData> getType(String dictType)
    {
        return dictTypeService.selectDictDataByType(dictType);
    }

    /**
     * 根据字典类型和字典键值查询字典数据信息
     * 
     * @param dictType 字典类型
     * @param dictValue 字典键值
     * @return 字典标签
     */
    public String getLabel(String dictType, String dictValue)
    {
        return dictDataService.selectDictLabel(dictType, dictValue);
    }

    public List<WxShopType> selectShopTypeList()
    {
        return wxShopTypeService.selectWxShopTypeList(null);
    }

    public WxCitys selectOneCity(Long id)
    {
        return citysService.selectWxCitysById(id);
    }

    public List<WxShopWords> queryWordsList() {
        WxShopWords wws = new WxShopWords();
        wws.setIsValid("0");
        return wordsService.selectWxShopWordsList(wws);
    }

    public List<WxCitys> queryCityList() {
        List<WxCitys> wxCitys = citysService.selectWxCitysList(null);
        return wxCitys;
    }


    public List<HandleType> selectHandleTypeList() {
        List<HandleType> list = handleTypeService.selectHandleTypeList(null);
        return list;
    }
}
